Skip to content

London | May 2025 | Samuel Tarawally | Sprint 1 | Coursework #660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

Tarawally
Copy link

@Tarawally Tarawally commented Jul 16, 2025

Learners, PR Template

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

  • Exercises: Solved the short programming tasks.
  • Errors: Interpreted error messages, and explained/fixed the issues.
  • Interpret: Read and explained the larger programs.

@Tarawally Tarawally linked an issue Jul 16, 2025 that may be closed by this pull request
@Tarawally Tarawally added Needs Review Participant to add when requesting review and removed Needs Review Participant to add when requesting review labels Jul 16, 2025
@Tarawally Tarawally changed the title London | 25-ITP-May | Samuel Tarawally | Sprint 1 | Coursework London | May 2025 | Samuel Tarawally | Sprint 1 Jul 16, 2025
@Tarawally Tarawally changed the title London | May 2025 | Samuel Tarawally | Sprint 1 London | May 2025 | Samuel Tarawally | Sprint 1 | Coursework Jul 16, 2025
@Tarawally Tarawally added the Needs Review Participant to add when requesting review label Jul 16, 2025
@Tarawally Tarawally marked this pull request as ready for review July 16, 2025 15:55
@cjyuan cjyuan added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Jul 17, 2025
Copy link
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explanation is very clear. Good job.

I just have a few suggestions and questions.

Comment on lines +8 to +10
// Line 3 reassigns the 'count' variable.
// It evaluates the right side first (0 + 1 = 1), and then assigns that result back to the 'count' variable.
// The 'count' variable is often used to keep track of the number of iterations or occurrences in a loop or process.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Operation like count = count + 1 is very common in programming, and there is a programming term describing such operation.

Can you find out what one-word programming term describes the operation on line 3?

Comment on lines +10 to +11

console.log(`The random number is: ${num}`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you describe how the expression at line 4 works?

Can you also describe the possible values that could be assigned to num using the interval notation ?

  • [, ] => inclusion
  • (, ) => exclusion
    For example, we can say, "Math.random() returns a random number in the interval [0, 1)".

Comment on lines +53 to +58
// 5. const pence = paddedPenceNumberString.substring(paddedPenceNumberString.length - 2).padEnd(2, "0");
// This line extracts and formats the pence part of the price.
// - It declares a constant variable named `pence`.
// - It uses `substring(paddedPenceNumberString.length - 2)` on `paddedPenceNumberString` ("399").
// - This extracts the last two characters of the string, which are "99".
// - The `padEnd(2, "0")` method ensures the extracted pence value has at least two digits.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we expect this program to work as intended for any valid penceString if we deleted .padEnd(2, "0") from the code?
In other words, do we really need .padEnd(2, "0") in this script?

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review and removed Needs Review Participant to add when requesting review Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Jul 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reviewed Volunteer to add when completing a review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

03 Complete Sprint 1 Coursework
2 participants